package com.ap.core.business.message.header.response.translators.impl;

import com.ap.core.business.message.domain.translators.BindingMetaData;
import com.ap.core.business.message.response.translators.ResponseMetaData;
import com.ap.core.business.message.response.translators.ResponseTranslator;
import com.ap.core.business.message.response.translators.header.impl.AbstractMsgHdrResponseTranslator;
import com.ap.core.business.message.response.translators.listener.ResponseListener;
import com.ap.core.common.types.InputMessageType;
import com.ap.core.cxf.jaxb.managepayment.ConfirmPaymentMsgType;
import com.ap.core.cxf.jaxb.msghdr.MsgHdrType;
import com.ap.core.exception.BusinessFailureException;
import com.ap.core.message.info.PaymentResponseMessageInfo;
import com.ap.core.message.info.RequestMessageInfo;

/**
 * User: Ranjit.Singh
 * implementation class for {@link ResponseTranslator} to populate {@link MsgHdrType}  in response object
 */
public class ConfirmPaymentMsgHdrResponseTranslator extends AbstractMsgHdrResponseTranslator<ConfirmPaymentMsgType>{


    /**
     * {@inheritDoc
     */
    @Override
    public void populateResponse(RequestMessageInfo<ConfirmPaymentMsgType> request, PaymentResponseMessageInfo response, BindingMetaData bindingMetaData, ResponseMetaData responseMetaData, ResponseListener responseListener) throws BusinessFailureException {
        
    	final InputMessageType inputMessageType = InputMessageType.getMessageType(request.getMsgHdr().getMsgType().name());
    	bindingMetaData.setInputMessageType(inputMessageType);
    	 
    	buildMsgHdrType(request.getMsgHdr().getMsgId(), response, responseListener, inputMessageType);
    }

	
	

   
}
